package com.itheima.mapper.backend;


import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckMapper {

    @Insert("insert into t_checkitem(code,name,sex,age,price,type,remark,attention) values(#{code},#{name},#{sex},#{age},#{price},#{type},#{remark},#{attention})")

    void add(CheckItem checkItem);

    @Delete("delete from t_checkitem where id =#{id}")
    void delete(Integer id);

    @Select("select checkitem_id from t_checkgroup_checkitem where checkgroup_id=#{checkgroupId}")
    List<Integer> findCheckItemIdsByCheckGroupId(Integer checkgroupId);

    void edit(CheckItem checkItem);

    List<CheckItem> list(String name);

    @Select("select * from t_checkitem ")
    List<CheckItem> findAll();

    @Select("select * from t_checkitem where id=#{id}")
    CheckItem findById(Integer id);
}
